package cn.com.b2office.service.impl;

import java.util.List;

import cn.com.b2office.dao.AddressDao;
import cn.com.b2office.dao.CountyDao;
import cn.com.b2office.domain.City;
import cn.com.b2office.domain.County;
import cn.com.b2office.domain.District;
import cn.com.b2office.service.AddressService;

/**
 * @author zhenggang
 * @version Jul 18, 2008 1:56:50 PM comment
 */
public class AddressServiceImpl implements AddressService {

	private AddressDao addressDao = null;

	private CountyDao countyDao = null;

	public void setAddressDao(AddressDao addressDao) {
		this.addressDao = addressDao;
	}

	public void setCountyDao(CountyDao countyDao) {
		this.countyDao = countyDao;
	}

	@Override
	public List<City> listCities() {
		List<City> list = addressDao.listCities();
		return list;
	}

	@Override
	public List<District> listDistrictsByCityId(int cityId) {

		return addressDao.listDistrictsByCityId(cityId);
	}

	@Override
	public List<County> listCountiesByDistrictId(int districtId) {

		return addressDao.listCountiesByDistrictId(districtId);
	}

	public County getCounty(int countyId) {
		return countyDao.getCounty(countyId);
	}

	public List<District> listDistricts() {
		return addressDao.listDistricts();
	}

}
